<{include file="app/header.tpl"}>

    <{if $status == 1}>

        <div class="reset-pwd-ok">
            <a class="a" href="/user/ucenter">密码修改成功，点击返回个人中心</a>
        </div>

    <{else}>
    <form method="POST" class="reset-pwd"  onsubmit="return form_user_resetpwd(this)">
        <input type="hidden" name="referrer" value="<{$referrer}>">

        <p class="wrap"><input type="password" class="number" name="password" id="" placeholder="设置新密码" required></p>
        <p class="wrap"><input type="password" class="password" name="password2" id="" placeholder="重复输入新密码" required></p>
        <p class="error"></p>

        <p class="wrap"><input type="submit" class="submit" name="submit" id="" value="保存"></p>

    </form>
    <{/if}>

<script>
function form_user_resetpwd(formItem)
{
    var pwd1 = formItem.password.value;
    var pwd2 = formItem.password2.value;

    if (pwd1 != pwd2)
    {
        $('.error').html('密码不相符，请检查');
        return false;
    }
    else if (pwd1.length < 6)
    {
        $('.error').html('密码不能少于6位');
        return false;
    }

    return true;
}

</script>

<{include file="app/footer.tpl"}>
